<template>
  <div id="app">
    <div class="mask" v-if="isLoading">
      <vue-loading type="bars" class="loadingTip" :style="{width: '50px', height: '50px'}" color="#d9544e"></vue-loading>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
// import $ from 'jquery'
import { VueLoading } from 'vue-loading-template'
import { mapState } from 'vuex'

export default {
  name: 'app',
  computed: {
    ...mapState({
      isLoading: 'ajaxQuery',
    }),
  },
  components: {
    VueLoading
  },
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
  color: #2c3e50;
  margin-top: 20px;
}
.mask {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 9999;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.3);
}
.mask::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  height: 100%;
  width: 1px;
}
.loadingTip {
  vertical-align: middle;
  display: inline-block;
}
</style>
